package com.caiwl.demo.kotlin.ctrl

import com.caiwl.demo.kotlin.entity.Organization
import com.caiwl.demo.kotlin.service.ProductService
import com.caiwl.demo.kotlin.util.Result
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.domain.Pageable
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author caiwl
 * @date 2020/5/28 17:25
 */
@RestController
@RequestMapping("/organization")
class OrganizationCtrl {
    @Autowired
    var productService: ProductService? = null

    @GetMapping
    fun page(organization: Organization, page: Pageable): Result {
        return Result("00000", "一切ok", productService!!.page(organization, page))
    }
}